package com.wjl.springcloudalibaba.sentinel.gatewaysentinel.config;

import com.alibaba.csp.sentinel.adapter.gateway.zuul.fallback.ZuulBlockFallbackManager;
import com.wjl.springcloudalibaba.sentinel.gatewaysentinel.fallback.CustomizedBlockFallbackProvider;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;

/**
 * @author wjl
 */
@Configuration
public class GatewayRuleConfig implements CommandLineRunner {

    @Override
    public void run(String... args) throws Exception {
        // 注册Zuul BlockFallbackProvider
        ZuulBlockFallbackManager.registerProvider(new CustomizedBlockFallbackProvider());
    }
}